package simpledb.buffer;

import simpledb.file.Page;

/**
 * An interface used to initialize a new block on disk. There will be an
 * implementing class for each "type" of disk block.<br>
 * 用于在磁盘上初始化新块的接口。 每个“类型”的磁盘块将有一个实现类。
 * 
 * @author Edward Sciore
 */
public interface PageFormatter {
  /**
   * Initializes a page, whose contents will be written to a new disk block.
   * This method is called only during the method {@link Buffer#assignToNew}.
   * <br>
   * 初始化一个页面，其内容将被写入一个新的磁盘块。 此方法仅在方法{@link Buffer#assignToNew}期间调用。
   * 
   * @param p a buffer page
   */
  public void format(Page p);
}
